package nio;

import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;

import java.io.*;

/****
 *
 */
public class Test {
    public static void main(String[] args) throws IOException {
        Reader reader = new StringReader("shenzhen china");
        BufferedReader br = new BufferedReader(reader);
        OutputStream os = new ByteOutputStream();
        while (br.read() != -1) {
            String   str  =br.readLine();
            System.out.println(str);
            byte[] lines =str.getBytes();
            os.write(lines);
        }
        //os.flush();
        //os.close();


    }
}
